<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="csstitle/QVerify.min.css">
		<script src="js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/QVerify.min.js" type="text/javascript"></script>
		<script type="text/javascript">
		//获取失去焦点 显示请输入手机号和密码
			            function a(){
                                if(document.getElementById("uid").value==""){
                                        document.getElementById("uid").value="请输入手机号";
                                }
                        }
                        function b(){
                                if(document.getElementById("uid").value=="请输入手机号"){
                                        document.getElementById("uid").value="";
                                }
                        }
                        function c(){
                                if(document.getElementById("pwd").value==""){
                                        document.getElementById("pwd").value="请输入密码";
                                }
                        }
                        function d(){
                                if(document.getElementById("pwd").value=="请输入密码"){
                                        document.getElementById("pwd").value="";
                                }
                        }
                  //人机验证
                    	function verify() {
                    		QVerify({
                    			name: "人机验证",  
                    			desc: "滑动滑块，使图片显示角度为正",  
                    			cloneTxt: "点我关闭",  
                    			successTxt: "验证成功，{0}秒后自动关闭",  
                    			errorTxt: "验证失败，请重试",
                    			images: [
                    				
                    				"img/t5.png",
                    				"img/t6.png",
                    				"img/t7.png",
                    				"img/t8.png",
                    				"img/t9.png"
                    			],  // 图片数组
                    			duration: 2,  //定时关闭时间 默认 2
                    			mountDiv: "#QVerify",  // 装载div
                    			slideDifference: 5,  // 滑动误差值
                    			defaultDifference: 50,  // 默认图片角度最小差值
                    			mousedown: function (e) {},
                    			mousemove: function (e, moveWidth) {},
                    			mouseup: function (e, moveWidth) {},
                    			success: function () {  // 验证成功事件
                    				location.href="main.html";
                    			},
                    			fail: function () {},
                    			complete: function () {},
                    			clone: function (status) {}
                    		});
                    	};
                //点击btn按钮   验证登录
                        $(function(){                       	                       
                        		 $("#btn").click(function(){
                        			 if($("#rad").prop("checked")){
                        				 $.ajax({
                               			  url:"login",
                               			  data:{
                               				 uid:$("#uid").val(),       
                               				 pwd:$("#pwd").val()  
                               			  },
                               			  success:function(d){
                               				 // if(d=="99"){
               //管理员登录成功，跳转到admin主页     
                                                // verify("admin");           							
                               				  //}else 
                               					  if(d=="0"){
               //登录成功，跳转到main主页
                                                 verify();  
                               				  }else{
                               					QVerify({
                                        			name: "人机验证",  
                                        			desc: "滑动滑块，使图片显示角度为正",  
                                        			cloneTxt: "点我关闭",  
                                        			successTxt: "验证成功，{0}秒后自动关闭",  
                                        			errorTxt: "验证失败，请重试",
                                        			images: [

                                        				"img/t5.png",
                                        				"img/t6.png",
                                        				"img/t7.png",
                                        				"img/t8.png",
                                        				"img/t9.png"
                                        			],  // 图片数组
                                        			duration: 2,  //定时关闭时间 默认 2
                                        			mountDiv: "#QVerify",  // 装载div
                                        			slideDifference: 5,  // 滑动误差值
                                        			defaultDifference: 50,  // 默认图片角度最小差值
                                        			mousedown: function (e) {},
                                        			mousemove: function (e, moveWidth) {},
                                        			mouseup: function (e, moveWidth) {},
                                        			success: function () {  },
                                        			fail: function () {},
                                        			complete: function () {},
                                        			clone: function (status) {alert("账号或密码不正确，请重新登录");}
                                        		});
                               					 
                               				  }
                               			  }  
                               		  }); 
                        		   }else{
                        			   alert("请勾选用户协议");
                        		   } 
                              }); 
                        	 var c=document.cookie;
                             var arr=c.split(";");            
                             for(var i=0;i<arr.length;i++){
                             	var key=arr[i].split("=")[0];
                             	var val=arr[i].split("=")[1];           	
                             	if(key.trim()=="uid"){
                             		document.getElementById("uid").value=val
                             		document.getElementById("rem").checked=false;
                             	}
                             	
                         /*    	if(key.trim()=="pwd"){
                             		document.getElementById("pwd").value=val
                             		document.getElementById("rem").checked=false;
                             	}
                         */
                             }
                           });
		</script>
		<style type="text/css">
		*{margin:  0px;padding: 0px;}
			#top{width: 1500px;height: 100px;margin: auto;}
			#logo{margin-top: 35px;}
			#middle{width: 1500px;height: 650px;margin: auto;background: #f7f7f7;}
			#mleft{margin: 113px 0px 112px 300px; position: relative;float: left;}
			#mright{width: 375px;height: 450px;margin: 100px 150px 100px 0px;background: #FFFFFF;float: right;}
			.a0:link {color:#000000;text-decoration:none;}
            .a0:visited {color:#000000;text-decoration:none;}
		    #title>ul>li{list-style: none; float: left;width: 120px;text-align: center;margin: 60px 5px  5px  40px;
			                  height: 30px;line-height: 20px;color: #999999;font-family: "微软雅黑";font-size:bold;font-size: 20px;}
			#l0{border-bottom:2px solid #ff6633}
			#login{width: 320px;height: 100px;margin-left: 25px;padding: 40px 0px;float: left;}
			#login1{border: dashed 1px lightgray;}
			#bottom{width: 1500px;height: 150px;margin: auto;}
			#bottom1{margin-left: 350px;font-family:"宋体";color: #8c8c8c;}
		</style>
	</head>
		<div id="top">
			<div id="logo"><a href="index.html"  target="_self"><img src="img/logoword.jpg"/></div>			
		</div>
		<div id="middle">
			<div id="mleft"><img src="img/loginpicture.jpg"/></div>
			<div id="mright">
				<div id="title">
					<ul>
						<li id="l0"><a href="login.html" class="a0" target="_self">密码登录</a></li>
						<li id="l1"><a href="reg.html" class="a0" target="_self">用户注册</a></li>					
					</ul>
				</div><br/><br/>
				<div id="login">
					<input type="text" id="uid" value="请输入手机号" style="width: 320px;height: 40px;font-size: 20px;color: #999999;"  onblur="a()" onfocus="b()"/><br/><br/>
					<input type="text" id="pwd" value="请输入密码" style="width: 320px;height: 40px;font-size: 20px;color: #999999;"  onblur="c()" onfocus="d()"/><br/><br/>
					<input  type="checkbox" name="rem" value="0" id="rem"/>记住密码</br><br/>
					<button id="btn"  style="width: 320px;height: 40px;background: #ff6633;color: #FFFFFF;border: hidden;"><h2>登录</h2></button><br/><br/>
					<div id="QVerify" style="visibility: hidden"></div>
					<div id="login1"></div><br/>
					<input type="checkbox" id="rad" value="" />我已经阅读并同意吃货联盟网相关政策协议
				</div>
			</div>
		</div>
		<div id="bottom"><img src="img/bottom.jpg"/><div id="bottom1">©2022 chihuo.com,All Rights Reserved. 本站发布的所有内容，未经许可，不得转载，详见《知识产权声明》</div>
		</div>
	</body>
</html>
